package cn.xawl.gulimall.search.controller;

import cn.xawl.common.to.es.SkuEsModel;
import cn.xawl.common.utils.R;
import cn.xawl.gulimall.search.service.EsProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lh
 * @date 2020/08/15 15:31:27
 **/
@RequestMapping("/search/save")
@RestController
public class ElasticSaveController {
    @Autowired
    private EsProductService esProductService;

    /**
     * 上架商品
     */
    @PostMapping("/product")
    public R productSearchSave(@RequestBody List<SkuEsModel> skuEsModels) {
        esProductService.upProduct(skuEsModels);

        return R.ok();
    }

}
